package testing;

import java.net.MalformedURLException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.sql.DriverManager;
import java.sql.SQLException;

import server.DBConnection;

import com.mysql.jdbc.Connection;
import common.NameOccupiedException;

public class MysqlTest {

	public static void main(String[] args) throws RemoteException, MalformedURLException, NotBoundException {
	String[] details = common.LoginDetails.getLoginDetails();
	
	String URL = details[0];
	String username = details[1];
	String password = details[2];
	
		try
		{
			DBConnection dbc = new DBConnection(URL,"javanetwork",username,password, new server.MarketplaceImpl());
			//dbc.registerUser("kikkoo2","hej");
			//dbc.logout("kikkoo");
			//System.out.println(dbc.getLoginStatus("kikkoo"));
			//dbc.login("kikkoo", "hej");
			//dbc.getLoginStatus("kikkoo2");
			//dbc.logout("kikkoo2");
			//dbc.login("kikkoo2", "hej");
			System.out.println(dbc.getLoginStatus("kikkoo2"));


			
		} catch (SQLException e)
		{
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}


}
